//
//  SEGSharedCommentInfoModel.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/10/19.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGSharedCommentInfoModel.h"

@implementation SEGSharedCommentInfoModel
- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    if (self) {
        _content = @"";
        _time = @"";
        _id = @"";
        _childComment = [NSArray array];
        _objType = @"";
        _praiseCount = @"";
        _isPraise = @"";
        _communityName = @"";
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
- (void)setValue:(id)value forKey:(NSString*)key
{
    if ([key isEqualToString:@"childComment"]) {
        if ([value isKindOfClass:[NSArray class]]) {
            NSMutableArray* _arrM = [NSMutableArray array];
            for (NSDictionary* dict in value) {
                SEGSharedCommentChildCommentModel* model = [SEGSharedCommentChildCommentModel initWithDictionary:dict];
                [_arrM addObject:model];
            }
            _childComment = _arrM.copy;
        }
        return;
    }

    [super setValue:value forKey:key];
}
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}
- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{}
- (void)setContent:(NSString*)content{
    _content = [[SEGUtils ValueToString:content]copy];
}
- (void)setTime:(NSString*)time{
    _time = [[SEGUtils ValueToString:time]copy];
}
- (void)setId:(NSString*)id{
    _id = [[SEGUtils ValueToString:id]copy];
}
- (void)setObjType:(NSString*)objType{
    _objType = [[SEGUtils ValueToString:objType]copy];
}
- (void)setPraiseCount:(NSString*)praiseCount{
    _praiseCount = [[SEGUtils ValueToString:praiseCount]copy];
}
- (void)setIsPraise:(NSString*)isPraise{
    _isPraise = [[SEGUtils ValueToString:isPraise]copy];
}
- (void)setCommunityName:(NSString *)communityName{
    _communityName = [[SEGUtils ValueToString:communityName]copy];
}
@end
